From 2530bdc02eaf7d9129e7811d3991f3a266268911 Mon Sep 17 00:00:00 2001 From: Victor Vasiliev Date: Sun, 28 Sep 2008 16:28:35 +0000 Subject: [PATCH] Some code cleanup per Nikerabbit --- includes/specials/SpecialListUserRestrictions.php | 5 ++--- includes/specials/SpecialRemoveRestrictions.php | 4 +--- includes/specials/SpecialRestrictUser.php | 8 ++++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/includes/specials/SpecialListUserRestrictions.php b/includes/specials/SpecialListUserRestrictions.php index 3c986db9eb..908bdc1a9e 100644 --- a/includes/specials/SpecialListUserRestrictions.php +++ b/includes/specials/SpecialListUserRestrictions.php @@ -25,8 +25,7 @@ class SpecialListUserRestrictionsForm { public function getHTML() { global $wgRequest, $wgScript, $wgTitle; $s = ''; - $legend = wfMsgHtml( 'listuserrestrictions-legend' ); - $s .= "
{$legend}"; + $s .= Xml::fieldset( wfMsg( 'listuserrestrictions-legend' ) ); $s .= "
"; $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() ); $s .= Xml::label( wfMsgHtml( 'listuserrestrictions-type' ), 'type' ) . ' ' . @@ -40,7 +39,7 @@ class SpecialListUserRestrictionsForm { $s .= ' '; $s .= Xml::inputLabel( wfMsgHtml( 'listuserrestrictions-page' ), 'page', 'page', false, $wgRequest->getVal( 'page' ) ); - $s .= Xml::submitButton( wfMsgHtml( 'listuserrestrictions-submit' ) ); + $s .= Xml::submitButton( wfMsg( 'listuserrestrictions-submit' ) ); $s .= "

"; return $s; } diff --git a/includes/specials/SpecialRemoveRestrictions.php b/includes/specials/SpecialRemoveRestrictions.php index 2c157aec87..ded6cbe3d7 100644 --- a/includes/specials/SpecialRemoveRestrictions.php +++ b/includes/specials/SpecialRemoveRestrictions.php @@ -17,8 +17,6 @@ function wfSpecialRemoveRestrictions() { return; } - $legend = wfMsgHtml( 'removerestrictions-legend' ); - $form = array(); $form['removerestrictions-user'] = $sk->userLink( $r->getSubjectId(), $r->getSubjectText() ) . $sk->userToolLinks( $r->getSubjectId(), $r->getSubjectText() ); @@ -34,7 +32,7 @@ function wfSpecialRemoveRestrictions() { $result = wfSpecialRemoveRestrictionsProcess( $r ); $wgOut->addWikiMsg( 'removerestrictions-intro' ); - $wgOut->addHTML( "
{$legend}" ); + $wgOut->addHTML( Xml::fieldset( wfMsgHtml( 'removerestrictions-legend' ) ) ); if( $result ) $wgOut->addHTML( '' . wfMsgExt( 'removerestrictions-success', 'parseinline', $r->getSubjectText() ) . '' ); diff --git a/includes/specials/SpecialRestrictUser.php b/includes/specials/SpecialRestrictUser.php index 8ce4b042db..d79d15c644 100644 --- a/includes/specials/SpecialRestrictUser.php +++ b/includes/specials/SpecialRestrictUser.php @@ -40,7 +40,7 @@ class RestrictUserForm { public static function selectUserForm( $val = null, $error = null ) { global $wgScript, $wgTitle; $legend = wfMsgHtml( 'restrictuser-userselect' ); - $s = "
{$legend}
"; + $s = Xml::fieldset( $legend ) . ""; if( $error ) $s .= '

' . $error . '

'; $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() ); @@ -53,7 +53,7 @@ class RestrictUserForm { public static function existingRestrictions( $restrictions ) { require_once( dirname( __FILE__ ) . '/SpecialListUserRestrictions.php' ); $legend = wfMsgHtml( 'restrictuser-existing' ); - $s = "
{$legend}
    "; + $s = Xml::fieldset( $legend ) . '
      '; foreach( $restrictions as $r ) $s .= UserRestrictionsPager::formatRestriction( $r ); $s .= "
"; @@ -82,7 +82,7 @@ class RestrictUserForm { } $useRequestValues = $wgRequest->getVal( 'type' ) == UserRestriction::PAGE; $legend = wfMsgHtml( 'restrictuser-legend-page' ); - $wgOut->addHTML( "
{$legend}" ); + $wgOut->addHTML( Xml::fieldset( $legend ) ); if( $error ) $wgOut->addHTML( '' . $error . '' ); if( $success ) @@ -145,7 +145,7 @@ class RestrictUserForm { } $useRequestValues = $wgRequest->getVal( 'type' ) == UserRestriction::NAMESPACE; $legend = wfMsgHtml( 'restrictuser-legend-namespace' ); - $wgOut->addHTML( "
{$legend}" ); + $wgOut->addHTML( Xml::fieldset( $legend ) ); if( $error ) $wgOut->addHTML( '' . $error . '' ); if( $success ) -- 2.20.1